//
//  XYToolsBarView.m
//  新项目
//
//  Created by xmy on 2017/2/28.
//  Copyright © 2017年 xmy. All rights reserved.
//

#import "XYToolsBarView.h"

@implementation XYToolsBarView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setupUI];
    }
    return self;
}

- (void)setupUI{
    
    UIButton *lookAfterButton = [[UIButton alloc]init];

    lookAfterButton.titleLabel.font = [UIFont systemFontOfSize:12];
    [lookAfterButton setImage:[UIImage imageNamed:@"timeline_icon_retweet"] forState:UIControlStateNormal];
    [lookAfterButton setTitle:@"4万+" forState:UIControlStateNormal];
   [lookAfterButton setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal];
    
    
    UIButton *commentButton = [[UIButton alloc]init];
    commentButton.titleLabel.font = [UIFont systemFontOfSize:12];
    [commentButton setImage:[UIImage imageNamed:@"timeline_icon_retweet"] forState:UIControlStateNormal];
    [commentButton setTitle:@"4万+" forState:UIControlStateNormal];
    [commentButton setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal];
    
    
    UIButton *likeButton = [[UIButton alloc]init];
    likeButton.titleLabel.font = [UIFont systemFontOfSize:12];
    [likeButton setImage:[UIImage imageNamed:@"timeline_icon_retweet"] forState:UIControlStateNormal];
    [likeButton setTitle:@"4万+" forState:UIControlStateNormal];
    [likeButton setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal];
    
    
    [self addSubview:lookAfterButton];
    [self addSubview:commentButton];
    [self addSubview:likeButton];
    
    [lookAfterButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.equalTo(self);
        make.width.equalTo(commentButton);
    }];
    [commentButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(lookAfterButton);
        make.left.equalTo(lookAfterButton.mas_right);
        make.width.equalTo(likeButton);
    }];
    [likeButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(lookAfterButton);
        make.left.equalTo(commentButton.mas_right);
        make.right.equalTo(self);
        make.width.equalTo(lookAfterButton);
    }];
}



@end
